<template>
  <div class="Showcase2">
    <div class="shadow-box">
      <img class="shadow-left" :src="publicUrls + 'free/style5/Showcase2dy1.webp'" alt="" />
      <div
        class="shadow-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style5/Showcase2dy2.webp'})`,
        }"
      ></div>
      <img class="shadow-right" :src="publicUrls + 'free/style5/Showcase2dy3.webp'" alt="" />
    </div>
    <div class="Showcase2-top">
      <img
        class="Showcase2-top-left"
        :src="publicUrls + 'free/style5/Showcase2bg1.webp'"
        alt=""
      />
      <div
        class="Showcase2-top-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style5/Showcase2bg2.webp'})`,
        }"
      ></div>
      <img
        class="Showcase2-top-right"
        :src="publicUrls + 'free/style5/Showcase2bg3.webp'"
        alt=""
      />
    </div>
    <div class="Showcase2-center">
      <div
        class="Showcase2-center-left"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style5/Showcase2bg4.webp'})`,
        }"
      ></div>
      <div class="Showcase2-center-center"></div>
      <div
        class="Showcase2-center-right"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style5/Showcase2bg5.webp'})`,
        }"
      ></div>
    </div>
    <div class="Showcase2-bottom">
      <div
        :style="{
          left: `${ShowcaseItemTransform(item.x ? item.x : getParentX(index), item.width, 1.375)}rem`,
        }"
        class="ex-item"
        v-for="(item, index) in props.list"
        :key="index"
      >
        <p class="name-box">
          {{ item.name }}
        </p>
      </div>
      <img
        class="Showcase2-bottom-left"
        :src="publicUrls + 'free/style5/Showcase2bg6.webp'"
        alt=""
      />
      <div
        class="Showcase2-bottom-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style5/Showcase2bg7.webp'})`,
        }"
      ></div>
      <img
        class="Showcase2-bottom-right"
        :src="publicUrls + 'free/style5/Showcase2bg8.webp'"
        alt=""
      />
    </div>
    <!-- Showcase2Topleft -->
  </div>
</template>   

<script lang="ts">
export default defineComponent({
  name: 'style2',
});
</script>
  
<script setup lang="ts">
import { ShowcaseItemTransform } from '@/utils/setmaterialStyle';
import { publicUrls } from '@/utils/minxin';
import { defineComponent } from 'vue';
const props = defineProps({
  list: {
    type: Object,
  },
});
const getParentX = (indexs: number) => {
  let x = 0;
  for (let index = 0; index < indexs; index++) {
    // const element = array[index];
    x = x + props.list[index].width;
  }

  return x + 0.3;
};
</script>  

<style scoped lang="less">
.Showcase2 {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 416px;
  min-width: 236px;
  -webkit-box-reflect: none;
}
.Showcase2-top {
  display: flex;
  width: 100%;
  height: 12px;
}
.Showcase2-top-left {
  width: 53px;
  height: 12px;
}
.Showcase2-top-center {
  flex: 1;
  height: 12px;
  background-repeat: repeat;
  background-size: auto 100%;
}
.Showcase2-top-right {
  width: 56px;
  height: 12px;
}
.ex-item {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 40px;
  width: 198px;
  height: 25px;
  z-index: 30;
  background: rgba(216, 224, 220, 1);
  border: 1px solid rgba(139, 186, 173, 1);
  border-radius: 42px;
}
.name-box {
  display: block;
  width: 177px;
  height: 24px;
  font-family: SourceHanSerifCN-Bold;
  font-size: 16px;
  color: rgba(63, 95, 92, 1);
  line-height: 24px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.Showcase2-center {
  position: relative;
  display: flex;
  width: 100%;
  height: calc(100% - 282px);
}
.Showcase2-center-left {
  width: 53px;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% auto;
}
.Showcase2-center-center {
  flex: 1;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.Showcase2-center-right {
  width: 56px;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% auto;
}
.Showcase2-bottom {
  position: relative;
  display: flex;
  width: 100%;
  height: 270px;
}
.Showcase2-bottom-left {
  width: 53px;
  height: 270px;
}
.Showcase2-bottom-center {
  flex: 1;
  height: 270px;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.Showcase2-bottom-right {
  width: 56px;
  height: 270px;
}
.shadow-box {
  display: flex; 
  align-items: flex-end;
  position: absolute;
  bottom: -416px; 
  left: 0;
  z-index: -1;
  width: 100%;
  height: 470px;
  opacity: 0.15;
}
.shadow-left {
  width: 53px;
  height: 462px;
  margin-bottom: 8px;
}
.shadow-center {
  flex: 1;
  height: 424px;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.shadow-right {
  width: 31px;
  height: 416px;
  margin-bottom: 8px;
}
</style>